/**
 * 全局变量注入
 * 
 * @author Gill Gong
 */
import store from "~/common/store"
import { Dimensions, PixelRatio } from "react-native"
import _ from "~/common/underscore-addition"
import EventBus from "~/services/event-bus"
import { Header } from "react-navigation-stack"
import config from "~/config"

global._ = _
global.Jw = {
  gEventBus: new EventBus(),

  getToken: store.getToken,
  getUser: store.getUser,

  getConfig() {
    
    return config
  },

  getHeaderHeight() {

    return Header.HEIGHT
  },

  getPixelRatio() {

    return PixelRatio.get()
  },

  getClientWidthAndHeight() {
    let { width, height } = Dimensions.get('window')

    return { width, height }
  }
}

export default Jw

